package com.simple.util.exception;

import com.simple.util.common.ErrorUtil;


public class SysException extends RuntimeException{
    /** The Constant serialVersionUID. */
    private static final long serialVersionUID = 1L;
    
    /** The app error. */
    private final String appError;
    
    /** The parent throwable. */
    private Throwable parentThrowable;
    
    public SysException(final String appError, final Throwable nestedThrowable) {
        super();
        this.appError = appError;
        this.parentThrowable = nestedThrowable;
    }

    public SysException(final String appError) {
        super();
        this.appError = appError;
    }

    public String getAppError() {
        return appError;
    }

    public Throwable getParentThrowable() {
        return parentThrowable;
    }
    
    public String getMessage() {
        return ErrorUtil.generateStackTraceString(this);
    }
}
